<template>
  <el-dialog
    title="监测信息"
    :visible.sync="dialogVisible"
    top="10vh" width="900px">
  <el-row :gutter="10">
    <el-col :span="16">
      <el-image v-if="isImg"
        style="width: 100%; height: 100%"
        :src="imageUrl">
      </el-image>
      <video  alt="" v-if="(!isImg)" style="width: 100%; height: 100%" controls>  
        <source :src="imageUrl" type="video/mp4">
      </video>
    </el-col>
    <el-col :span="8">
      <el-form :model="formdata" label-width="80px" inline>
          <el-form-item label="物种名称">
            <el-input v-model="formdata.speciesName"></el-input>
          </el-form-item>
          <el-form-item label="监测体长">
            <el-input v-model="formdata.bodyLength"></el-input>
          </el-form-item>
          <el-form-item label="监测体重">
            <el-input v-model="formdata.weight"></el-input>
          </el-form-item>
          <el-form-item label="环境温度">
            <el-input v-model="formdata.temperature"></el-input>
          </el-form-item>
          <el-form-item label="环境湿度">
            <el-input v-model="formdata.humidness"></el-input>
          </el-form-item>
          <el-form-item label="监测时间">
            <el-input v-model="formdata.createdTime"></el-input>
          </el-form-item>
      </el-form>
    </el-col>
  </el-row>
  

    <span slot="footer" class="dialog-footer">
      <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
    </span>
  </el-dialog>
</template>

<script>
export default {
  data() {
    return {
      dialogVisible: false,
      formdata: {
          bodyLength: '',
          createdTime: '',
          humidness:'',
          speciesName:'',
          temperature:'',
          weight:''
        },
        imageUrl:null,
        isImg:true
    };
  },
  methods: {
    open() {
      this.dialogVisible = true;
    },
    setData( data ,isImg){
      this.formdata = data;
      this.isImg = isImg;
      this.imageUrl = this.$imageServer+ data.imageUrl;
      this.dialogVisible = true;
    }
  }
};
</script>

<style lang="scss" scoped>
  ::v-deep {
  .el-dialog {
    // background: #fff;
    background: rgba(33, 124, 147, 0.7);

    .el-dialog__header {
      border-bottom: 1px solid white;
    }

    .el-dialog__title {
      color: #fff
    }

    .el-dialog__headerbtn .el-dialog__close {
      color: #fff
    }

    .dialog-footer {
      display: flex;
      justify-content: flex-end;

      .el-button {
        color: #fff;
      }
    }

    .el-form-item__label {
      color: #fff;
    }
  }
}
</style>